#dockerfile文件有修改，修改版源自于云原生训练营第4组优秀作业：https://github.com/SignorMercurio/cncamp_homework
FROM golang:1.17.1 AS builder

RUN mkdir /app
ADD . /app
WORKDIR /app
RUN cd src && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-w -s" -gcflags "-N -l" -o ../bin/httpserver

FROM alpine AS production
WORKDIR /app
COPY --from=builder /app/bin/httpserver .
CMD ["./httpserver"]
